package cn.zl.springbootmqtt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * @Description:井盖状态监测
 * @Author: zllwsy
 * @Date: 2020/11/5 16:41
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@TableName("wk_device_alarm")
@ApiModel("设备告警信息表")
public class AlertInfo {

    @ApiModelProperty(value = "主键")
//    @TableId(value = "ID",type = IdType.AUTO)
    @TableField(value = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    private Long id;

    @ApiModelProperty("设备编号")
    @TableField(value = "WDA_DEVICE_CODE")
    private String wdaDeviceCode;

    @ApiModelProperty("设备类型(11:路灯,12:LED,21:井盖)")
    @TableField(value = "WDA_DEVICE_TYPE")
    private String wdaDeviceType;

    @ApiModelProperty("告警类型")
    @TableField(value = "WDA_ALARM_TYPE")
    private String wdaAlarmType;

    @DateTimeFormat(pattern = "yyyy-MM-dd")//入参格式化
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")//出参格式化
    @ApiModelProperty("告警时间")
    @TableField(value = "WDA_ALARM_TIME")
    private Date wdaAlarmTime;

    @ApiModelProperty("告警内容")
    @TableField(value = "WDA_ALARM_CONTENT")
    private String wdaAlarmContent;

    @ApiModelProperty("备注")
    @TableField(value = "WDA_REMARK")
    private String wdaRemark;
}
